<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>代码生成</title>
    <meta name="keywords" content="代码生成" />
    <meta name="description" content="代码生成" />
    <link rel="shortcut icon" href="favicon.ico" />

    <!-- 引入公共css -->
	<#include "/inc/header.ftl"/>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="page-title-box">
                <p class="page-title">
                    数据连接列表
                </p>
            </div>
            <div class="tabs-container">
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body">
                            <form method="get" class="form-horizontal" id="invoiceSearchForm">
                                <!-- 可供库存物资 -->
                                <div class="row">
                                    <div class="col-sm-12">
                                        <div class="ibox float-e-margins iboxBorder">
                                            <div class="ibox-content">
                                                <div class="row">
                                                    <div class="col-sm-12">
                                                        <div class="col-sm-3">
                                                            <div class="form-group">
                                                                <label class="col-sm-4 control-label">数据库名称</label>
                                                                <div class="col-sm-8">
                                                                    <input type="text" class="form-control" name="dbName">
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="row">

                                                    <div class="col-sm-12 text-right">
                                                        <button class="btn btn-bac-none" type="reset">重置</button>
                                                        <button class="btn btn-success" id="searchBtn" type="button"><i class="fa fa-search"></i>&nbsp;&nbsp;查询</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>

                            <div class="row">
                                <div class="col-sm-12" >
                                    <div class="ibox" >
                                        <div class="ibox-content iboxpadding">
                                            <div class="margin-bottom-10">
                                                <a href="/auto/code/dbInfo/create" type="button" class="btn btn-success">新增数据库</a>
                                                <button type="button" class="btn btn-success" id="delDBInfo">删除</button>
                                            </div>
                                            <div id="tableList"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- 引入公共js -->
<#include "/inc/footer.ftl"/>

<!-- Page-Level Scripts -->
<script>
    $(document).ready(function() {
        loadTable();

        $("#searchBtn").click(function () {
            loadTable();
        });

        $("#delDBInfo").click(function () {
            var selectIds = checkbox.getCheckedboxIds("#tableList");
            $.ajax({
                url : '/auto/code/dbInfo/del',
                type : 'POST',
                data : {
                    idList : selectIds
                },
                success : function(data) {
                    window.location.href = "/auto/code/dbInfo/list";
                },
                error : function(result) {
                    parent.layer.alert("发生错误！");
                }
            });
        });

    });

    function getParams() {
        var formData = $("#orderSearchForm").serializeJson();
        formData.pageSize = 10;
        formData.pageNum = 1;
        return formData;
    }

    function loadTable() {
        var paramJson = getParams();
        $("#tableList").pagination({
            url : "/auto/code/dbInfo/list",
            paramJson : paramJson,
            callback:function(){
            }
        });
    }
</script>


</body>

</html>

